home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Assembly Language Step by Step
/
Assembly Language Step by Step.mdf
/
ForDOS
/
ASM
/
UpCase.mac
< prev
next >
Wrap
Text File
|
1999-09-18
|
699b
|
13 lines
%macro UpCase 2 ; Target,Length
mov CX,%2 ; CX is acting as length counter for loop
mov BX,%1 ; String will be at DS:BX
%%Tester: cmp BYTE [BX],'a' ; Is string character below 'a'?
jb %%Bump ; If so, leave character alone
cmp BYTE [BX],'z' ; Is string character above 'z'?
ja %%Bump ; If so, leave character alone
and BYTE [BX],11011111b ; Char is lc alpha, so force bit 5 to 0
%%Bump: inc BX ; Bump BX to point to next char in string
loop %%Tester ; And go back and do it again!
%endmacro